/* Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * SPDX-License-Identifier: MulanPSL-2.0
 */

#pragma once

enum FalconCode {
    FALCON_SUCCESS = 0,

    FALCON_ERR_INVALID_PARAM,
    FALCON_ERR_UNSUPPORTED,
    FALCON_ERR_FULL,
    FALCON_ERR_BUSY,
    FALCON_ERR_OBJ_LEN_EXCEED,

    FALCON_ERR_OBJ_NOT_EXISTS,
    FALCON_ERR_OBS_INVALID_ARG,
    FALCON_ERR_OBS_DENY,
    FALCON_ERR_OBS_INSUFFICIENT,

    FALCON_ERR_INNER_FAILED
};

enum FalconInnerErrorCode {
    OK = 0,

    FALCON_IEC_MALLOC_FAILED = 1000,
    FALCON_IEC_INIT_FTDS_FAILED,
    FALCON_IEC_INIT_OBS_FAILED,
    FALCON_IEC_INIT_LOG_FAILED,
    FALCON_IEC_INIT_CONF_FAILED,
    FALCON_IEC_INIT_THREAD_POOL_FAILED,
    FALCON_IEC_NEED_RETRY,

    FALCON_IEC_KV_READ_FAILED = 1100,
    FALCON_IEC_KV_NEXT_FAILED,
    FALCON_IEC_KV_HAS_NEXT_FAILED,
    FALCON_IEC_KV_WRITE_FAILED,
    FALCON_IEC_KV_SEAL_FAILED,
    FALCON_IEC_KV_APPEND_FAILED,
    FALCON_IEC_KV_DELETE_FAILED,
    FALCON_IEC_KV_MMAP_FAILED,

    FALCON_IEC_KV_FAILED_BUSY = 1200,
    FALCON_IEC_KV_FAILED_SEAL,
    FALCON_IEC_KV_FAILED_CONFLICT,
    FALCON_IEC_KV_FAILED_KEY_NOT_EXIST,

    FALCON_IEC_OBS_GET_FAILED = 1300, // TOFO: in original video all "FAILED" in this trunk are mistyped to "FAIELD"
    FALCON_IEC_OBS_FAILED_BUSY,
    FALCON_IEC_OBS_FAILED_INVALID_ARG,
    FALCON_IEC_OBS_FAILED_KEY_NOT_EXIST,
    FALCON_IEC_OBS_FAILED_DENY,
    FALCON_IEC_OBS_FAILED_INSUFFICIENT,

    FALCON_IEC_GRPC_SEND_FAILED = 1400,
    FALCON_IEC_GRPC_NO_CLIENT,

    FALCON_IEC_DAEMON_EXEC_FAILED = 1500,

    FALCON_IEC_UNKNOWN_ERROR = 9999
};
